﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DB_Connection
{
    class DataBaseCommand
    {
        private readonly string sqlString;
       
       private readonly  DatabaseConnection dbcon;
        

        public DataBaseCommand(string sql, DatabaseConnection db)
            {
            if (String.IsNullOrWhiteSpace(sql))
                throw new ArgumentException("no sql");
                             sqlString=sql;
            if (db == null)
                throw new ArgumentException("no db connection");
                 dbcon = db;

    }
         public void Execute()
        {
            dbcon.OpenConnection();
            Console.WriteLine(sqlString);
            dbcon.CloseConnection();
        }


    }
}
